﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ComponentModel.DataAnnotations;

namespace Upreader.Application.Model
{
    /// <summary>
    /// Represents a file within an usenet operation
    /// </summary>
    public class File : ModelBase
    {
        #region Properties

        /// <summary>
        /// Get or set the Id of the download this file belongs to
        /// </summary>
        public int DownloadId { get; set; }

        /// <summary>
        /// Get or set a collection of groups where this file resides in
        /// </summary>
        public ICollection<string> Groups { get; set; }

        /// <summary>
        /// Get or set the title for this file. This is purely for visual representation
        /// </summary>
        [Required(AllowEmptyStrings = false)]
        public string Title { get; set; }

        /// <summary>
        /// Get or set the name of the file which is used as a representation on the disk
        /// </summary>
        [Required(AllowEmptyStrings = false)]
        public string FileName { get; set; }

        /// <summary>
        /// Get or set the name of the posted of this file
        /// </summary>
        public string Poster { get; set; }

        /// <summary>
        /// Get or set the moment in time when this file was inserted
        /// </summary>
        public DateTime Inserted { get; set; }

        /// <summary>
        /// Get or set the moment in time when this file was posed 
        /// </summary>
        public DateTime Posted { get; set; }

        /// <summary>
        /// Get or set the priority of the file
        /// </summary>
        public int Priority { get; set; }

        /// <summary>
        /// Get or set the state of the files
        /// </summary>
        public FileState State { get; set; }

        /// <summary>
        /// Get or set the type in which the file was identified
        /// </summary>
        public FileType Type { get; set; }

        /// <summary>
        /// Get or set a hint to indicate which encoding would be used for this file
        /// </summary>
        public FileEncoding Encoding { get; set; }

        #endregion // Properties
    }
}
